using SimpleFramework;
using System.Collections.Generic;

namespace Game
{
    public static class Config
    {
        public static ServerConfig Server { get { return DataCenter.GetJson<ServerConfig>(); } }
        public static readonly KeyTable<CfgConfig> Cfg = new KeyTable<CfgConfig>();
        public static readonly IdxTable<CfgRole> Role = new IdxTable<CfgRole>();
        public static readonly IdxTable<CfgWeapon> Weapon = new IdxTable<CfgWeapon>();

        public static void Load(System.Action<ILoader, byte[]> onProgress, System.Action onComplete)
        {
            DataCenter.AddJson<ServerConfig>();
            //DataCenter.Add(typeof(CfgConfig), Cfg);
            //DataCenter.Add(typeof(CfgRole), Role);
            //DataCenter.Add(typeof(CfgWeapon), Weapon);
            DataCenter.Load(onProgress, onComplete);
        }
    }
}
